#include "stack.h"

int main(int argc, char** argv) {
	Stack s;
	s.push(1);
	s.push(2);
	s.push(3);
	s.push(4);

	
	std::cout << "Original stack: ";
	s.printStack();
	
	Stack s2 = Stack::copyStack(s);
	std::cout << "Copied stack: ";
	s2.printStack();

	
	std::cout<<"pop: ";
	std::cout<<s.pop()<<std::endl;
	std::cout<<"getPeek: ";
	std::cout<<s.getPeek()<<std::endl;
	std::cout<<"getSize: ";
	std::cout<<s.getSize()<<std::endl;
	std::cout<<"checkElement: ";
	std::cout<<s.checkElements(1)<<std::endl;
	std::cout<<"clear: ";
	s.clear();
	std::cout<<s.getSize()<<std::endl;

	Stack s3;
	s3.push(1);
	s3.push(2);
	s3.push(3);
	s3.push(4);
	
	int valueToSearch = 1;
	int position = s3.searchEelements(valueToSearch);
	if (position != -1) {
		std::cout << "元素 " << valueToSearch << " 在栈中的位置是: " << position << std::endl;
	} else {
		std::cout << "元素 " << valueToSearch << " 不在栈中。" << std::endl;
	}
	
	std::cout<<"reverse stack: ";
	s3.reverse();
	s3.printStack();
	
	
	return 0;
}
